<html>
    <head>
    	<script type="text/javascript" src="default/wlclient/js/phonegap.js"></script>
        <script type="text/javascript" src="default/js/skinLoader.js"></script>
        <script src="default/js/messages.js"></script>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" />
    </head>
    <script>
	    function loadSkin(){
	    	document.addEventListener("deviceready", function() {
				var exitOnSkinLoader = PhoneGap.exec(null, null, "Utils", "readPref", ["exitOnSkinLoader"]);
				if (eval(exitOnSkinLoader)) {
		    		PhoneGap.exec(null, null, "App", "exitApp", []);
		    	} else {
		    		try{
						PhoneGap.exec(null, null, "NativeBusyIndicator", "show", [WL.ClientMessages.loading]);
			    	} catch (e) {
			    	}
					var skinName = "default";
					if (typeof window.getSkinName == "function") {
						skinName = getSkinName();
					}
					PhoneGap.exec(null, null, "Utils", "writePref", ["exitOnSkinLoader", "true"]);
					PhoneGap.exec(null, null, "Utils", "writePref", ["wlSkinName", skinName]);
					PhoneGap.exec(null, null, "Utils", "loadSkin", [skinName,"index.html"]);
		    	}
			}, false);
		}
    </script>
	<body onload="loadSkin()" style="background-color: black"></body>
</html>
